package com.example.hao.flowercityfm.mvp.presenter;

import com.example.hao.flowercityfm.mvp.modle.HomeFModel;
import com.example.hao.flowercityfm.mvp.modle.IHomeFModel;
import com.example.hao.flowercityfm.mvp.view.IHomeFView;
import com.example.hao.flowercityfm.pojo.HomeFragmentData;

public class HomeFPresenter implements IHomeFPresenter {

    private IHomeFModel model;
    private IHomeFView view;


    public HomeFPresenter( IHomeFView view) {
        this.model = new HomeFModel();
        this.view = view;
    }

    @Override
    public void loadData() {
        model.loadData( new IHomeFModel.onCallBack() {
            @Override
            public void onSuccess(HomeFragmentData homeData) {
                view.updateHomeDataInfo(homeData);
            }

            @Override
            public void onFailure(Throwable e) {
                view.showErrInfo(999,e.getMessage());
            }
        });
    }
}
